package com.lml.permissionx

import android.annotation.SuppressLint
import android.app.Application
import android.content.Context

/**
 * 全局获取context
 * 还需要在AndroidManifest.xml的<application>中配置android:name=".MyApplication"，使得程序启动的时候初始化MyApplication类而不是默认的Application类
 * 获取方法：MyApplication.context
 */

class MyApplication : Application() {
    companion object {
        @SuppressLint("StaticFieldLeak")
        lateinit var context: Context
    }

    override fun onCreate() {
        super.onCreate()
        context = applicationContext
    }
}